<template>
  <div class="boss">
    <Top></Top>
    <Banner id="11"></Banner>
    <chamber></chamber>
    <div class="war">
      <div class="area-center">
        <Head title="商企库"> </Head>
        <!-- 商企库区域 -->
        <div class="top">
          <!-- 用户单位文字区域 -->
          <div class="umit title-center">
            <div
              class="xiao m-t-07"
              v-for="(item, index) in list"
              :key="index"
              @click="shangqiku(item)"
            >
              <div class="left">
                <div class="yuan" :class="['zhong']"></div>
              </div>
              <div class="zhong" :class="['zhong']">
                {{ item.commercetypeName }}
              </div>
            </div>
          </div>
        </div>
        <!-- 底部须知 -->

        <div class="h3 title-center">{{ Headtitle.title }}</div>
        <!-- 内容区域 -->
        <div class="context richText bold-size" v-html="context"></div>
      </div>
    </div>
  </div>
</template>

<script>
import Top from "@/components/Home/TopPage.vue";
import Banner from "@/components/Home/BannerView.vue";
import chamber from "@/components/Home/CommCe.vue";
import Head from "@/components/public/HeadPage.vue";
import { discusslist, findById } from "@/api/index";
export default {
  data() {
    return {
      list: [],
      text: "",
      title: "",
      Headtitle: "", //须知标题
      context: "", //须知内容
    };
  },
  components: {
    Top,
    Banner,
    chamber,
    Head,
  },
  methods: {
    shangqiku(item) {
      if (item.commercetypeId == "17cc35ca-e8e7-4dc7-9e27-ba21f0637ab7") {
        this.$router.push({ path: "/commpage" });
      } else {
        this.$router.push({
          path: "/shangnew",
          query: {
            id: item.commercetypeId,
          },
        });
      }
    },
  },
  mounted() {
    discusslist({
      commercetypeIdenti: "one",
    }).then((res) => {
      if (res.data.code == 200) {
        this.list = res.data.data;

        // this.xuzhi(res.data.rows[0].commercetypeId)
      }
    }),
      //获取共享商企须知
      findById({
        otherId: "17cc35ca-e8e7-4dc7-9e27-ba21f0637ab7",
      }).then((res) => {
        if (res.data.code == 200) {
          this.Headtitle = res.data.data;
          this.context = this.dataHTML(res.data.data.context);
        }
      });
  },
};
</script>

<style scoped>
/* 大盒子区域 */
.boss {
  width: 100%;
}
/* 整体区域 */
.boa {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.05rem;
}

/* 版心区域 */
.center {
  width: 98%;
}
/* 大项目总区域 */
.top {
  width: 100%;
}
/* 图标区域 */
.top h3 img {
  width: 0.24rem;
  margin-right: 0.05rem;
}
.wen {
  width: 100%;
  height: 25%;
  display: flex;
  justify-content: center;
}
.xian {
  width: 98%;
  height: 100%;
  display: flex;
}
.le {
  width: 40%;
  height: 100%;
  line-height: 0.3rem;
  font-size: 0.18rem;
  padding-left: 0.1rem;
}
.le img {
  height: 0.3rem;
  float: right;
  padding: 0.05rem 0.1rem 0 0;
}
.h3 {
  height: 100%;
  text-align: center;
  line-height: 0.4rem;
}
/* 用人单位区域 */
.umit {
  width: 100%;
  min-height: 0.4rem;
  border-bottom: 2px solid #dad9df;
}
.xiao {
  width: 100%;
  display: flex;
}
/* 左边区域 */
.xiao .left {
  width: 5%;
  height: 0.3rem;
  margin-right: 0.07rem;
}
.yuan {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  background-color: black;
  margin-top: 0.06rem;
}
/* 中间区域 */
.zhong {
  line-height: 0.32rem;
}

/* 底部区域 */
.bottom {
  width: 100%;
  height: 100%;
  margin-top: 0.1rem;
  background-color: #f0eff5;
}

.bottom h3 {
  width: 100%;
  height: 0.35rem;
  text-align: center;
}
/* 内容区域 */
.context {
  width: 100%;
  word-wrap: break-word;
}
</style>